package com.example.Android_test.specs;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: dns
 * Date: 05.05.13
 * Time: 21:44
 * To change this template use File | Settings | File Templates.
 */
public class WordSpec {
    private ArrayList<TranslationVariantSpec> translationVariantSpecs = new ArrayList<TranslationVariantSpec>();

    private String word;
    private String transcription;
    private String description;
    private String descriptionTranslation;
    private String inContext;
    private String inContextTranslation;
    private String soundRes;

    private int rating;
    private int showed;

    private boolean removed;


    public WordSpec(){ }

    @Override
    public String toString() {
        String nl = System.getProperty("line.separator");
        String result = "";

        result += "<word>" + nl;
        result += "<item>" + getWord() + "</item>" + nl;
        result += "<transcription>" + getTranscription() + "</transcription>" + nl;
        result += "<description>" + getDescription() + "</description>" + nl;
        result += "<descriptiontranslation>" + getDescriptionTranslation() + "</descriptiontranslation>" + nl;
        result += "<incontext>" + getInContext() + "</incontext>" + nl;
        result += "<incontextTranslation>" + getInContextTranslation() + "</incontextTranslation>" + nl;
        result += "<sound>" + getSoundResName() + "</sound>" + nl;
        result += "<rating>" + getRating() + "</rating>" + nl;
        result += "<showed>" + getShowed() + "</showed>" + nl;

        for (TranslationVariantSpec translationVariant : getTranslationVariantSpecs()) {
            result += "<translate-variant>" + nl;
            result += "<partofspeech>" + translationVariant.getPartOfSpeech() + "</partofspeech>" + nl;
            result += "<translate>" + translationVariant.getTranslate() + "</translate>" + nl;
            result += "<exampleofuse>" + translationVariant.getExampleOfUse() + "</exampleofuse>" + nl;
            result += "</translate-variant>" + nl;
        }
        result += "</word>" + nl;

        return result;
    }

    public String getInContextTranslation() {
        return inContextTranslation;
    }

    public void setInContextTranslation(String inContextTranslation) {
        this.inContextTranslation = inContextTranslation;
    }

    public String getSoundResName() {
        return soundRes;
    }

    public void setSoundRes(String soundRes) {
        this.soundRes = soundRes;
    }


    public String getInContext() {
        return inContext;
    }

    public void setInContext(String inContext) {
        this.inContext = inContext;
    }

    public String getDescriptionTranslation() {
        return descriptionTranslation;
    }

    public void setDescriptionTranslation(String descriptionTranslation) {
        this.descriptionTranslation = descriptionTranslation;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    public String getWord() {
        return word;
    }

    public void setWord(String eng) {
        this.word = eng;
    }

    public String getTranscription() {
        return transcription;
    }

    public void setTranscription(String transcription) {
        this.transcription = transcription;
    }

    public ArrayList<TranslationVariantSpec> getTranslationVariantSpecs() {
        return translationVariantSpecs;
    }

    public void setTranslationVariantSpecs(ArrayList<TranslationVariantSpec> translationVariantSpecs) {
        this.translationVariantSpecs = translationVariantSpecs;
    }

    public void addTranslationVariant(TranslationVariantSpec translationVariant) {
        this.translationVariantSpecs.add(translationVariant);
    }

    public int getRating() {
        return rating;
    }

    public void setRating(int rating) {
        this.rating = rating;
    }

    public int getShowed() {
        return showed;
    }

    public void setShowed(int showed) {
        this.showed = showed;
    }

    public boolean isRemoved() {
        return removed;
    }

    public void setRemoved(boolean removed) {
        this.removed = removed;
    }



   /* WordSpec(String wordTranslation, String transcription, float rating, int showed, boolean removed){
        this.wordTranslation = wordTranslation;
        this.transcription = transcription;
        this.rating = rating;
        this.showed = showed;
        this.removed = removed;
    }*/

   /* public void addRusVariant(String partOfSpeech, String wordTranslation, String context){
        translationVariantSpecs.add(new TranslationVariantSpec(partOfSpeech, wordTranslation, context));
    }*/

}
